package cn.ljy.uem.web.action.backstage.school;

import cn.ljy.authority.web.controller.backstage.BaseBackstageController;
import cn.ljy.common.model.result.ResponseData;
import cn.ljy.uem.model.SchoolCourseSection;
import cn.ljy.uem.model.query.SchoolCourseSectionQuery;
import cn.ljy.uem.service.SchoolCourseSectionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;


/**
 * 课程章节模块控制器
 * @author 小锋
 * @date 2022/08/22
 */
@Api(tags = "后台的课程章节模块")
@RestController
@RequestMapping(value = "/api/backstage/school/schoolCourseSection")
public class SchoolCourseSectionController extends BaseBackstageController<SchoolCourseSection, SchoolCourseSectionQuery, String> {

    @Autowired
    private SchoolCourseSectionService schoolCourseSectionService;

    @ApiOperation(value = "课程章节")
    @GetMapping("/all")
    @Override
    protected ResponseData query(SchoolCourseSectionQuery schoolCourseSectionQuery) {
        return super.query(schoolCourseSectionQuery);
    }


    @ApiOperation(value = "读取课程章节信息")
    @Override
    protected ResponseData get(@PathVariable("id") String id) {
        return super.get(id);
    }

    @ApiOperation(value = "批量删除指定的多个课程章节")
    @Override
    protected ResponseData deletes(@NotEmpty(message = "操作失败：请选择要移除的记录") String[] ids) {
        return super.deletes(ids);
    }


    @ApiOperation(value = "添加课程章节")
    @Override
    protected ResponseData add(@Valid @RequestBody SchoolCourseSection schoolCourseSection) {
        return super.add(schoolCourseSection);
    }

    @ApiOperation(value = "编辑课程章节")
    @Override
    protected ResponseData edit(@Valid @RequestBody SchoolCourseSection schoolCourseSection) {
        return super.edit(schoolCourseSection);
    }

/*    @GetMapping("/CourseIdBySection")
    @ApiOperation(value = "通过课程id查找章节")
    protected ResponseData CourseIdBySection( @Valid Long CourseId) {
        return ResponseData.success(schoolCourseSectionService.CourseIdBySection(CourseId));
    }*/

}
